]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
autorun-manager: Fix 'destroy' handler of resident source
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 13 Jul 2011 19:22:35 +0000 (21:22 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 13 Jul 2011 19:43:30 +0000 (21:43 +0200)
If the resident source is destroyed, it should be recreated
immediately, so that it is available when another volume is
mounted. However, we only connect to the 'destroy' signal
on the original source, not on newly created ones. As a result,
the resident source only works twice, after that it shows up
without icon and an empty notification.

Fix by always connecting to the source's 'destroy' signal.

js/ui/autorunManager.js

index 5ba4868da5bd456811942a2a7a38eaef36593269..2eb2bddafdd2ef6822a0b556ebb1b3c4c2327311 100644 (file)
@@ -164,11 +164,7 @@ AutorunManager.prototype = {
                                               this._onMountRemoved));
 
         this._transDispatcher = new AutorunTransientDispatcher();
-        this._residentSource = new AutorunResidentSource();
-        this._residentSource.connect('destroy', Lang.bind(this,
-            function() {
-                this._residentSource = new AutorunResidentSource();
-            }));
+        this._createResidentSource();
 
         let mounts = this._volumeMonitor.get_mounts();
 
@@ -182,6 +178,13 @@ AutorunManager.prototype = {
         }));
     },
 
+    _createResidentSource: function() {
+        this._residentSource = new AutorunResidentSource();
+        this._residentSource.connect('destroy',
+                                     Lang.bind(this,
+                                               this._createResidentSource));
+    },
+
     _onMountAdded: function(monitor, mount) {
         // don't do anything if our session is not the currently
         // active one